FROM java:8

MAINTAINER wenbdong "wenbindong@163.com"
 
RUN apt-get update
RUN apt-get -q -y install elasticsearch

RUN apt-get -q -y install openssh-server
RUN sed -i 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config

RUN echo "root:123456" | chpasswd

RUN ssh-keygen -q -y -t dsa -f /etc/ssh/ssh_host_dsa_key
RUN ssh-keygen -q -y -t rsa -f /etc/ssh/ssh_host_rsa_key

RUN mkdir /var/run/sshd
EXPOSE 22
EXPOSE 9200
CMD ["/usr/sbin/sshd", "-D"]
CMD ["/usr/share/elasticsearch/bin/elasticsearch"]